package com.hiray.taglayoutmanager;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hiray.taglayoutmanager.uitility.ClickableViewHolder;

/**
 * Created by hiray on 2017/12/13.
 *
 * @author hiray
 */

public class HirayAdapter extends RecyclerView.Adapter<ClickableViewHolder> {


    private Context context;

    @Override
    public ClickableViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (context == null)
            context = parent.getContext();
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        int resId = context.getResources().getIdentifier("small" + (viewType), "layout", context.getPackageName());
        return new ClickableViewHolder(layoutInflater.inflate(
                resId, parent, false
        ));
    }

    @Override
    public void onBindViewHolder(ClickableViewHolder holder, int position) {

    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public int getItemCount() {
        return 12;
    }


}
